Mirror queue in a shared queue environment

ABSTRACT

A queue management system and a method of managing a queue. This system and method are for use with a parallel processing system including a plurality of clients and a plurality of processors. The clients receive messages and transmit the messages to a shared queue for storage, and the processors retrieve messages from the shared queue and process said messages. The queue management system includes a mirror queue for maintaining a copy of each message transmitted to the shared queue by one of the clients; and means, running on said one of the clients, for storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the clients. The mirror queue provides the system with continuity in case of an outage of the shared queue. In the event of such an outage, each instance of an application can simply discontinue using the shared queue and process requests from the mirror queue. The mirror queue is used until the shared queue is once again available. Preferably, the copy of each message transmitted to the mirror queue is provided with a reference, such as a pointer, to the location of the message on the shared queue. When a client receives a request for a particular message, the client is able to search its mirror queue for the copy of the message. Also, if necessary, the client, after finding the copy on the mirror queue, is able to use the reference in that copy to find the message on the shared queue.

BACKGROUND OF THE INVENTION

[0001] 1. Technical Field

[0002] The present invention relates generally to parallel processing environments, and more specifically to a shared queue for a multi-processor environment.

[0003] 2. Background Art

[0004] It is commonplace in contemporary data processing environments to provide a plurality of systems to handle the processing needs of one or more clients. For example, two or more systems, such as transaction processing systems, may be interfaced to one or more clients via a communications network. In this environment, when a client has a task to be performed by one of the systems, that client sends an input message to the desired system to request processing by an application running in that system. The subject system queues the message and provides the message to the application for processing. When processing is complete, the application places an outgoing message in the queue for transmission over the network to the client.

[0005] To take advantage of the multi-processing aspect of this environment, the system originally tasked by the client, system A, may extract the input message from its queue and forward the input message to a second system, system B, for processing. When processing is completed by system B, the response (outgoing message) is forwarded to system A and placed on system A's queue for transmission to the client. Thus, in this manner, multiple systems can be utilized to handle processing requests from numerous clients.

[0006] There are, however, a few disadvantages with this arrangement. For example, if system A fails, none of the work on the queue of system A can be accessed. Therefore, the client is forced to wait until system A is brought back online to have its transaction processed.

[0007] In order to address these disadvantages, a shared, or common, queue may be provided to store incoming messages for processing by any of a plurality of data processing systems. A common queue server receives and queues the messages onto the shared queue so that they can be retrieved by a system having available capacity to process the messages. In operation, a system having available capacity retrieves a queued message, performs the necessary processing, and places an appropriate response message back on the shared queue. Thus, the shared queue stores messages sent in either direction between clients requesting processing and the data processing systems that perform the processing.

[0008] Because the messages are enqueued onto the shared queue, the messages can be processed by an application running in any of a plurality of systems having access to the shared queue. Thus, automatic workload management among the plurality of systems is provided. Also, because any of the systems connected to the shared queue can process messages, an advantage of processing redundancy is provided. If a particular application that is processing a message fails, another application can retrieve that message from the shared queue and perform the processing without the client having to wait for the original application to be brought back on-line. This provides processing redundancy to clients of the data processing environment.

[0009] Implementing a shared queue introduces two unique problems, however. First, in case of an unexpected outage, the link to the shared queue or the storage associated with the shared queue may suffer an outage. Thus, while instances of the application that are generating and processing requests are still operable, the requests that have been placed onto the shared queue are not available. A second problem is that searching the shared queue for a particular request requires each instance of an application to search through all requests from all instances of the application.

SUMMARY OF THE INVENTION

[0010] An object of this invention is to improve data processing systems that use a shared queue to process messages.

[0011] Another object of the present invention is to maintain a mirror queue in the local storage of each instance of an application and to keep in that mirror queue a copy of each work request that was placed into a shared queue by that instance.

[0012] A further object of the invention is to provide a data processing system that uses a shared queue, with the ability to continue processing messages even in case of an outage of the shared queue or the storage associated with the queue.

[0013] These and other objectives are attained with a queue management system, and a method of managing a queue. This system and method are for use with a parallel processing system including a plurality of clients and a plurality of processors. The clients receive messages and transmit the messages to a shared queue for storage, and the processors retrieve messages from the shared queue and process said messages. The queue management system includes a mirror queue for maintaining a copy of each message transmitted to the shared queue by one of the clients; and means, running on said one of the clients, for storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the clients.

[0014] The mirror queue provides the system with continuity in case of an outage of the shared queue. In the event of such an outage, each instance of an application can simply discontinue using the shared queue and process requests from the mirror queue. The mirror queue is used until the shared queue is once again available.

[0015] Preferably, the copy of each message transmitted to the mirror queue is provided with a reference, such as a pointer, to the location of the message on the shared queue. When a processor receives a request for a particular message, the processor is able to search its mirror queue for the copy of the message. Also, if necessary, the processor, after finding the copy on the mirror queue, is able to use the reference in that copy to find the message on the shared queue.

[0016] Further benefits and advantages of the invention will become apparent from a consideration of the following detailed description, given with reference to the accompanying drawings which specify and show preferred embodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

[0017]FIG. 1 is a block diagram showing a shared queue in a client/server environment.

[0018]FIG. 2 illustrates a procedure for implementing and using a mirror queue in a shared queue environment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0019] The present invention generally relates to systems and methods that may allow any of a plurality of processing systems to process messages for one or more clients. In the preferred embodiment, a structured external storage device, such as a shared queue, is provided for queuing client messages for the plurality of systems. When incoming messages are received from the clients, they are placed on the shared queue. When one of the plurality of systems has available processing capacity, it retrieves a message, processes the message and places a response on the queue.

[0020]FIG. 1 is a block diagram illustrating the shared queue in a client/server environment 10. The client/server environment includes one or more clients 12 interfaced to a plurality of processing systems 14 via one or more networks 16. When a client 12 has a transaction to be processed, the client enqueues the message onto shared queue 20. As additional messages are received from clients, they too are enqueued onto shared queue 20. Each message remains on the shared queue 20 until the message is retrieved by one of the systems 14 for processing.

[0021] When a system 14 determines that it has the capacity to process another transaction, that system 14 dequeues a message from shared queue 20. That system 14 then processes the message and places on shared queue 20 the appropriate response to the client that generated the incoming message. A common queue server 22 provides the necessary interface between shared queue 20 and systems 14. When an input message is received by common queue server 22 for enqueueing onto shared queue 20, the queue server buffers the message in one or more buffers and then transfers this data to the shared queue. Any suitable common queue and common queue server may be used in the practice of this invention.

[0022] As mentioned above, two problems may be encountered when implementing a shared queue. In particular, in case of an unexpected outage, the link to the shared queue or the associated storage may suffer an outage. Also, searching the shared queue for a particular request requires each instance of an application to search through all requests from all instances of the application.

[0023] To address these problems, this invention uses a feature referred to as a “Mirror Queue,” which is a queue maintained in the local storage of each instance of an application and that contains a copy of each work request that was placed onto the shared queue by the instance. The Mirror Queue, described in detail below, provides several advantages. One advantage is that should the link to the shared queue or the storage associated with the shared queue suffer an outage, each instance of the application can immediately retrieve its outstanding work requests from its Mirror Queue without any losses. The application can process from the Mirror Queue until the outage is resolved. This guarantees that a request will be processed. Another advantage of using a mirror queue is that when needing access to a particular entry on the shared queue, an application can simply search through the requests on its Mirror Queue. Once the application finds the request it needs, it can easily find the corresponding request on the shared queue. Based on the number of instances sharing the common queue, this can greatly reduce the time that it takes to find a unique request. A third advantage is that the Mirror Queue can also serve as a work selection caching mechanism to obtain requests from the shared queue in anticipation of the request being selected by the instance.

[0024] Preferably, with reference to FIG. 2, when an instance of an application receives or generates a work request, as represented at step 32, the instance copies that request onto the shared queue at step 34. That instance, at step 36, then updates the local copy of the request with some type of immediate reference, such as a pointer, to the copy of the request on the shared queue. The immediate reference may be, or example, an entry id assigned to the request when it is put onto the shared queue. The local copy of the request is then, at step 40, placed onto the local Mirror Queue. After the request has been processed, the request is, at step 42, dequeued from the Mirror Queue.

[0025] If access to a particular request is needed (because, for instance, the request needs to be canceled, a user is requesting information about the request, etc), then instead of searching the entire shared queue, the application searches its Mirror Queue for the particular request, as represented at step 42. If the action being done against the request requires the shared queue copy, then, at step 44, the reference to the copy of the request on the shared queue is used to immediately access that copy. Accessing requests on the shared queue in this manner significantly reduces the number of requests that must be scanned, and avoids locking the entire shared queue during the search.

[0026] In the event of an outage of the shared queue, each instance of the application simply discontinues using the shared queue and processes requests from the Mirror Queue. The Mirror Queue is used until the shared queue is once again available. When the shared queue is available, outstanding requests are copied from the Mirror Queue to the shared queue and the shared queue is used once again. This technique makes outages of the shared queue transparent to the end user.

[0027] While it is apparent that the invention herein disclosed is well calculated to fulfill the objects stated above, it will be appreciated that numerous modifications and embodiments may be devised by those skilled in the art, and it is intended that the appended claims cover all such modifications and embodiments as fall within the true spirit and scope of the present invention. 

What is claimed is:
 1. A queue management system for use on a parallel processing system including a plurality of clients and a plurality of processors, wherein the clients transmit messages for storage on a shared queue, and the processors retrieve messages from the shared queue and process the messages, the queue management system comprising: a mirror queue on one of the clients for maintaining copies of messages transmitted to the shared queue by said one of the clients; and means, running on said one of the clients, for storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the clients.
 2. A queue management system according to claim 1, wherein the means for storing to the mirror queue includes means for providing the copy of each message storing to the mirror queue with a reference to the location of the message on the shared queue.
 3. A queue management system according to claim 2, wherein said reference is a pointer to the location of the message in the shared queue.
 4. A queue management system according to claim 2, wherein said one of the clients further includes means to receive a request for a particular message, and the queue management system further includes means, acting in response to the receipt by said one of the clients, to search the mirror queue for a copy of the particular message.
 5. A queue management system according to claim 4, wherein said means to search the mirror queue includes means, acting after the copy of the particular message is found, to use the reference in said copy to locate the message in the shared queue.
 6. A method of managing a queue for use with a parallel processing system including a plurality of clients and a plurality of processors, wherein the clients transmit messages for storage on a shared queue, and the processors retrieve messages from the shared queue and process said messages, the method comprising: maintaining a mirror queue for storing copies of messages transmitted to the shared queue by one of the clients; and storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the clients.
 7. A method according to claim 6, further comprising the step of, said one of the clients processing messages from the mirror queue in case messages are not available from the shared queue.
 8. A method according to claim 6, wherein the storing step includes the step of providing the copy of each message transmitted to the mirror queue with a reference to the location of the message on the shared queue.
 9. A method according to claim 8, wherein said reference is a pointer to the location of the message in the shared queue.
 10. A method according to claim 8, wherein each of said clients further includes a routine to receive a request for a particular message, and the method includes the further step of searching the mirror queue for a copy of the particular message in response to the receipt by one of the clients of the request for the particular message.
 11. A method according to claim 10, wherein said searching step includes the step of, after the copy of the particular message is found, using the reference in said copy to locate the message in the shared queue.
 12. A program storage device readable by machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing a queue, for use with a parallel processing system including a plurality of clients and a plurality of processors, wherein the clients transmitting messages for storage on a shared queue, and the processors retrieve messages from the shared queue and process said messages, the method steps comprising: maintaining a mirror queue for storing copies of message transmitted to the shared queue by one of the clients; and storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the clients.
 13. A program storage device according to claim 12, wherein said method steps further comprise the step of, said one of the clients processing messages from the mirror queue in case messages are not available from the shared queue.
 14. A program storage device according to claim 12, wherein the storing step includes the step of providing the copy of each message transmitted to the mirror queue with a reference to the location of the message on the shared queue.
 15. A program storage device according to claim 14, wherein said reference is a pointer to the location of the message in the shared queue.
 16. A program storage device according to claim 14, wherein each of said clients further includes a routine to receive a request for a particular message, and the method includes the further step of searching the mirror queue for a copy of the particular message in response to the receipt by one of the clients of the request for the particular message.
 17. A program storage device according to claim 16, wherein said searching step includes the step of, after the copy of the particular message is found, using the reference in said copy to locate the message in the shared queue.
 18. A parallel processing system comprising: a plurality of clients for receiving messages and transmitting the messages for storage on a shared queue; a plurality of processors for retrieving messages from the shared queue and processing said messages; each of said clients including i) means for maintaining a mirror queue for holding copies of messages transmitted to the shared queue by the client, and ii) means for storing to the mirror queue, a copy of each message transmitted to the shared queue by said one of the processors.
 19. A parallel processing system according to claim 18, wherein: the storing means includes means for providing the copy of each message transmitted to the mirror queue with a reference to the location of the message on the shared queue; and each of said clients further includes means, acting in response to the receipt by the client of a particular message, to search the mirror queue for a copy of the particular message, and, after the copy of the particular message is found, to use the reference in said copy to locate the message in the shared queue. 